﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Common.Logging;
using DotNetServiceLib;
using System.Net;

namespace dotNetServiceConsole
{
    class Program
    {
        private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        static void Main(string[] args)
        {
            log.Info("Starting console application!");
            log.Info("Starting console application!");
            string exeDirectory = Directory.GetCurrentDirectory() + "\\" + ApplicationContext.FileName;
            if (File.Exists(exeDirectory))
            {
                ApplicationContext appContext = new ApplicationContext(exeDirectory);
                string returnMessage = "";
                appContext.Load(ref returnMessage);
                Console.WriteLine(returnMessage);
            }
            else
            {
                Console.WriteLine(String.Format("Spring context's file could not be found in: {0}", exeDirectory));
            }
            Console.ReadKey();
        }
    }
}
